#!/usr/local/bin/python3.5
# -*- coding UTF-8

from flask import Flask, request, render_template

app = Flask(__name__)


@app.route("/", methods=['GET', 'POST'])
def index():
    return "hello index"


@app.route("/login", methods=['GET'])
def login():
    return render_template("login.html")


@app.route("/login", methods=['POST'])
def login2():
    username = request.form['username']
    password = request.form['pwd']
    if username == "kaiJi" and password == "kaiJi":
        return render_template("login.html", username=username + "001", pwd=password + "002")
    else:
        return "hello, you are error!!!"


if __name__ == '__main__':
    app.run(host="0.0.0.0", debug=True, port=8080)
